package com.mf.controller;

import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.mf.entity.RecommendCode;
import com.mf.entity.TapePurchaseHistory;
import com.mf.service.IRecommendCodeService;
import com.mf.service.ITapePurchaseHistoryService;
import com.mf.utils.Result;
import com.mf.utils.calculate.KdjCalculator;
import com.mf.vo.MACD.MACDVo;
import io.swagger.v3.oas.annotations.Operation;
import io.swagger.v3.oas.annotations.tags.Tag;
import jakarta.annotation.Resource;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;

import java.util.Collections;
import java.util.List;

/**
 * <p>
 * 收盘后推送的代买入历史股票代码 前端控制器
 * </p>
 *
 * @author mf
 * @since 2024-05-12
 */
@RestController
@RequestMapping("/stock/tapePurchaseHistory")
@Tag(name = "获取前一日可买入股票代码")
public class TapePurchaseHistoryController {
    @Resource
    private ITapePurchaseHistoryService tapePurchaseHistoryService;

    @Resource
    private IRecommendCodeService recommendCodeService;

    @Operation(summary = "查询前一日可买入的股票代码")
    @GetMapping("/findTapePurchase")
    public Result<List<TapePurchaseHistory>> findTapePurchase() {
        System.out.println(1);
        return Result.success(tapePurchaseHistoryService.list());
    }

    @Operation(summary = "计算前一日可买入的股票代码")
    @GetMapping("/calculatedBuyIn")
    public Result<Void> calculatedBuyIn() {
        System.out.println("开始");
        tapePurchaseHistoryService.remove(null);
        tapePurchaseHistoryService.calculatedBuyIn();
        System.out.println("结束");
        return Result.success(null);
    }



}
